﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SchoolLibrary.Entity.Person;

namespace SchoolLibrary.Desktop.Guide.Input
{
    public class WriterInputDialog : PersonInputDialog
    {
        private Writer writer;

        public WriterInputDialog() { }

        public WriterInputDialog(Writer writer) 
        {
            this.writer = writer;
            setPerson(writer);            
        }


        protected override void build(Person person)
        {
            base.build(person);
        }

        protected override void okButton_Click(object sender, EventArgs e)
        {
            if (writer == null)
            {
                writer = new Writer();
            }
            build(writer);
            this.Close();
        }

        public Writer Writer
        {
            get { return writer; }
        }

    }
}
